use 5.008008;
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.

WriteMakefile(
    NAME              => 'Bench::Test',
    VERSION_FROM      => 'lib/Bench/Test.pm', # finds $VERSION
    EXE_FILES         => [ qw(script/maketest script/createtests) ],
    #PREREQ_PM         => { IPC::Run, Term::ReadPassword, Expect }, Not yet
    #PREREQ_PM         => { 'GRID::Machine' },
    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
      (ABSTRACT_FROM  => 'lib/Bench/Test.pod', # retrieve abstract from module
       AUTHOR         => 'Juan Antonio <alu2807@etsii.ull.es>') : ()),
);

sub MY::postamble {
return <<"EOT";

TEST: pi test

pi: examples/pi/pi.c
	cd examples/pi;
	make

doc:tt2/Machine.tt2 tt2/Message.tt2 tt2/REMOTE.tt2 tt2/Result.tt2
	cd tt2; tpage  Machine.tt2 > ../lib/GRID/Machine.pod
	cd tt2; tpage  Message.tt2 > ../lib/GRID/Machine/Message.pod
	cd tt2; tpage  REMOTE.tt2 > ../lib/GRID/Machine/REMOTE.pod
	cd tt2; tpage  Core.tt2 > ../lib/GRID/Machine/Core.pod
	cd tt2; tpage  Result.tt2 > ../lib/GRID/Machine/Result.pod
	cd tt2; tpage  IOHandle.tt2 > ../lib/GRID/Machine/IOHandle.pod

pdf: @files
	atopdf @files -o /tmp/gridmachine.pdf

publicdist: publish rmdist dist
	chmod a+r GRID-Machine-*.tar.gz
	cp GRID-Machine-*.tar.gz /home/pp2/public_html/perlexamples/GRID-Machine.tar.gz
	cp GRID-Machine-*.tar.gz /tmp/
	chmod a+r /tmp/GRID-Machine-*.tar.gz

coverage: pi
	cover -delete
	make HARNESS_PERL_SWITCHES=-MDevel::Cover test
	cover


rmdist:
	rm -fR GRID-Machine-*.tar.gz
	rm -fR /tmp/GRID-Machine-*.tar.gz

xdvi: doc
	pod2latex -full -prefile preamble.tex lib/GRID/Machine.pod
	latex Machine
	latex Machine
	makeindex Machine; latex Machine.tex 
	pod2latex -full -prefile preamble.tex lib/GRID/Machine/IOHandle.pod
	latex IOHandle
	latex IOHandle
	makeindex IOHandle; latex IOHandle.tex 

html: doc
	mpod2html -nowarnings -noverbose -nonavigation -nobanner -noidx -notoc lib/GRID/Machine.pod
	mpod2html -nowarnings -noverbose -nonavigation -nobanner -noidx -notoc lib/GRID/Machine/Core.pod
	mpod2html -nowarnings -noverbose -nonavigation -nobanner -noidx -notoc lib/GRID/Machine/REMOTE.pod
	mpod2html -nowarnings -noverbose -nonavigation -nobanner -noidx -notoc lib/GRID/Machine/IOHandle.pod

publish: doc html xdvi
	cp *.html /home/pp2/public_html/GRID_Machine/
	cp *.dvi /home/pp2/public_html/GRID_Machine/
EOT
}

